# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnetfilter_conntrack
pkgver=1.0.9
pkgrel=3
pkgdesc="programming interface (API) to the in-kernel connection tracking state table"
url="https://www.netfilter.org/projects/libnetfilter_conntrack/"
arch="all"
license="GPL-2.0-or-later"
makedepends="linux-headers libnfnetlink-dev libmnl-dev"
subpackages="$pkgname-static $pkgname-dev"
source="https://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-$pkgver.tar.bz2
	fix_build_with_kernel_5.15_and_musl.patch
	"

prepare() {
 	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
e8b03425aaba3b72e6034c215656c34176d0550c08e0455aaeb1365d9141505d0c4feaa8978c8ccf2b7af9db6c9e874ceb866347e533b41cb03a189884f4004c  libnetfilter_conntrack-1.0.9.tar.bz2
1a93a36cf5cb89cec08e6e2476bf8d6fc68e9608f55e370418ed6a87e369545bdff1050e810aab2d5a9706f9559b3c1c48c404d954b2d01b84dbd68bae063450  fix_build_with_kernel_5.15_and_musl.patch
"
